﻿package com.leebrimelow.utils {	/*	 * A collection of static methods for common string operations.	*/		public class String2 	{		public static function count(haystack:String, needle:String, offset:Number=0):Number        {			var len:Number = haystack.length            var res:Number = 0;            haystack = haystack.slice(offset, len);            while (haystack.length > 0 && haystack.indexOf(needle) != -1)            {				haystack = haystack.slice((haystack.indexOf(needle) + needle.length));                res++;            }	            return res;        }	}}